<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-2.dtd">

<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>inline js test</title>
</head>
<body>
    <div th:fragment="script">
        <script type="text/javascript" th:inline="text">
/*<![CDATA[*/var x = 1;/*]]>*/
        </script>
    </div>
</body>
</html>